/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSkyRoom.bridge.sub;

import ru.jSkyRoom.bridge.JSkyBridge;
import ru.jSkyRoom.bridge.sub.model.ArmatureModelBridge;
import ru.jSkyRoom.interfaces.major.FormList;
import ru.jSkyRoom.interfaces.major.Texture;
import ru.jSkyRoom.interfaces.sub.ArmatureGenderSettings;
import ru.jSkyRoom.interfaces.sub.JSkyModel;
import skyproc.ARMA;
import skyproc.FormID;
import skyproc.genenums.Gender;
import skyproc.genenums.Perspective;

/**
 *
 * @author Rakev
 */
public class ArmatureGenderSettinsBridge extends JSkyBridge<ARMA> implements ArmatureGenderSettings {

    private Gender gender;

    public ArmatureGenderSettinsBridge(ARMA rawObject, Gender gender) {
        super(rawObject);
        this.gender = gender;
    }

    @Override
    public int getPriority() {
        return getRawObject().getPriority(gender);
    }

    @Override
    public void setPriority(int priority) {
        getRawObject().setPriority(priority, gender);
    }

    @Override
    public JSkyModel getModel(Perspective perspective) {
        return new ArmatureModelBridge(getRawObject(), gender, perspective);
    }

    @Override
    public Texture getSkinTexture() {
        FormID id = getRawObject().getSkinTexture(gender);
        return getFinderFactory().createTextureFinder().find(id);
    }

    @Override
    public void setSkinTexture(Texture texture) {
        FormID id = getIdProducer().produce(texture);
        getRawObject().setSkinTexture(id, gender);
    }

    @Override
    public FormList getSkinSwap() {
        FormID id = getRawObject().getSkinSwap(gender);
        return getFinderFactory().createFormListFinder().find(id);
    }

    @Override
    public void setSkinSwap(FormList swapList) {
        FormID id = getIdProducer().produce(swapList);
        getRawObject().setSkinSwap(id, gender);
    }
}
